home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
wrnsr094
/
wrn.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
14KB
|
451 lines
VERSION 2.00
Begin Form edit
Caption = "News Reader"
ClientHeight = 7350
ClientLeft = 1815
ClientTop = 1575
ClientWidth = 10005
ControlBox = 0 'False
Height = 8040
Icon = WRN.FRX:0000
Left = 1755
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 7350
ScaleWidth = 10005
Top = 945
Width = 10125
Begin TextBox Message_text
BackColor = &H00FFFFFF&
FontBold = -1 'True
FontItalic = 0 'False
FontName = "System"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 6855
Left = 0
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 600
Width = 9975
End
Begin PictureBox news_btn
Height = 495
Left = 5760
Picture = WRN.FRX:0302
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 8
Top = 0
Width = 495
End
Begin PictureBox mail_btn
Height = 495
Left = 5280
Picture = WRN.FRX:0604
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 7
Top = 0
Width = 495
End
Begin PictureBox uudecode_btn
Height = 495
Left = 4320
Picture = WRN.FRX:0906
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 6
Top = 0
Width = 495
End
Begin PictureBox rot13_btn
Height = 495
Left = 3840
Picture = WRN.FRX:0C08
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 5
Top = 0
Width = 495
End
Begin PictureBox cancel_btn
Height = 495
Left = 2880
Picture = WRN.FRX:0F0A
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 4
Top = 0
Width = 495
End
Begin PictureBox save_btn
Height = 495
Left = 2400
Picture = WRN.FRX:120C
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 3
Top = 0
Width = 495
End
Begin PictureBox load_btn
Height = 495
Left = 1920
Picture = WRN.FRX:150E
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 2
Top = 0
Width = 495
End
Begin PictureBox new_btn
Height = 495
Left = 1440
Picture = WRN.FRX:1810
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 1
Top = 0
Width = 495
End
Begin PictureBox next_btn
Height = 495
Left = 0
Picture = WRN.FRX:1B12
ScaleHeight = 465
ScaleWidth = 465
TabIndex = 9
Top = 0
Width = 495
End
Begin Menu clip_mnu
Caption = "&Edit"
Begin Menu edit_cut_mnu
Caption = "Cu&t"
Shortcut = ^T
End
Begin Menu edit_copy_mnu
Caption = "&Copy"
Shortcut = ^C
End
Begin Menu edit_paste_mnu
Caption = "&Paste"
Shortcut = ^P
End
End
Begin Menu info_mnu
Caption = "&Info"
End
Begin Menu help_mnu
Caption = "&Help"
End
End
Sub cancel_btn_Click ()
edit.message_text.text = ""
If message.list1.listcount > 0 Then
message.enabled = True
End If
message.catchup_btn.enabled = True: message.catchup_btn.backcolor = white
new_btn.enabled = True: new_btn.backcolor = white
cancel_btn.enabled = False: cancel_btn.backcolor = grey
mail_btn.enabled = False: mail_btn.backcolor = grey
news_btn.enabled = False: news_btn.backcolor = grey
End Sub
Sub edit_copy_mnu_click ()
' Copy currently highlighted text to the clipboard
Dim CopyString As String
If message_text.SelLength > 0 Then
CopyString = message_text.SelText
Clipboard.SetText CopyString
End If
End Sub
Sub edit_cut_mnu_click ()
' Cut currently selected text to the clipboard
Dim CutString As String
Dim CursorPosition As Integer
If message_text.SelLength > 0 Then
CursorPosition = message_text.SelStart
CutString = message_text.SelText
Clipboard.SetText CutString
message_text.text = Left$(message_text.text, message_text.SelStart) + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
message_text.SelStart = CursorPosition
End If
End Sub
Sub edit_paste_mnu_click ()
' Paste contents of clipboard into current card
Dim PasteText As String
Dim CursorPosition As Integer
CursorPosition = message_text.SelStart
PasteText = Left$(message_text.text, message_text.SelStart) + Clipboard.GetText()
PasteText = PasteText + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
message_text.text = PasteText
message_text.SelStart = CursorPosition + Len(Clipboard.GetText())
End Sub
Sub Form_DblClick ()
If Not mail_btn.enabled Then
message_text.SetFocus
If replying Then
msg_text$ = message_text.text
i& = InStr(msg_text$, Chr$(10))
While i& <> 0
msg_text$ = Left$(msg_text$, i&) + msg_quote$ + Mid$(msg_text$, i& + 1)
i& = i& + 3
i& = InStr(i&, msg_text$, Chr$(10))
Wend
message_text.text = msg_text$
Else
message_text.text = ""
End If
message.catchup_btn.enabled = False: message.catchup_btn.backcolor = grey
message.enabled = False
cancel_btn.enabled = True: cancel_btn.backcolor = white
mail_btn.enabled = True: mail_btn.backcolor = white
If Not reading_mail Then
news_btn.enabled = True: news_btn.backcolor = white
End If
End If
End Sub
Sub Form_Load ()
mail_btn.enabled = False: mail_btn.backcolor = grey
news_btn.enabled = False: news_btn.backcolor = grey
End Sub
Sub Form_Unload (Cancel As Integer)
Unload file_select
Unload aboutbox
End Sub
Sub get_block (ByVal file_no%, ByVal length%, dest$)
If Loc(file_no%) + length% > LOF(file_no%) Then
dest$ = dest$ + Input$(LOF(file_no%) - Loc(file_no%), file_no%)
Else
dest$ = dest$ + Input$(length%, file_no%)
End If
End Sub
Sub get_next_name (ByVal Path$, dest$)
i = 1
dest$ = Path$ + "." + Mid$(Str$(i), 2)
While Len(Dir$(dest$)) <> 0 And i < 1000
i = i + 1
dest$ = Path$ + "." + Mid$(Str$(i), 2)
Wend
End Sub
Sub Help_mnu_Click ()
res = winexec("WINHELP WRN.HLP", 1)
End Sub
Sub info_mnu_Click ()
edit.enabled = false
aboutbox.Show
End Sub
Sub load_btn_Click ()
filename$ = get_filename("c:\")
If Len(filename$) <> 0 Then
message_text.text = load_file(filename$)
End If
End Sub
Sub mail_btn_Click ()
dest$ = author$
sig% = 1
Call get_header(dest$, subject$, sig%, True)
seq_file = fopen(seq_path$, "r")
Input #seq_file, seq_num%
Close #seq_file
seq$ = Format$(seq_num%, "0000")
out_filename$ = out_path$ + seq$
date_time$ = Format$(Now, "ddd, dd mmm yy hh:mm:ss ") + time_zone$
cur_time# = Now
out_file = fopen(out_filename$ +